package com.iflysse.pojo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.alibaba.fastjson.JSON;


public class TreeJson implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private int pid;
	public int getPid() {
		return pid;
	}
	public void setPid(int pid) {
		this.pid = pid;
	}
	private String text;
	private String iconCls;
	private String state="open"; 
	private String checked;
	private List<TreeJson> children;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public List<TreeJson> getChildren() {
		return children;
	}
	public void setChildren(List<TreeJson> children) {
		this.children = children;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getChecked() {
		return checked;
	}
	public void setChecked(String checked) {
		this.checked = checked;
	}
	@Override
	public String toString() {
		return JSON.toJSONString(this);
	}
	public static void main(String[] args) {
		List<TreeJson> pre = new ArrayList<TreeJson>();
		
		TreeJson tree = new TreeJson();
		tree.setId(1);
		tree.setIconCls("a.jpg");
		tree.setState("open");
		tree.setText("用户管理");
		
		TreeJson ctree1 = new TreeJson();
		ctree1.setId(11);
		ctree1.setIconCls("a.jpg");
		ctree1.setState("open");
		ctree1.setText("用户管理1");
		
		TreeJson ctree2 = new TreeJson();
		ctree2.setId(12);
		ctree2.setIconCls("a.jpg");
		ctree2.setState("open");
		ctree2.setText("用户管理2");
		
		List<TreeJson> chil = new ArrayList<TreeJson>();
		
		chil.add(ctree1);
		chil.add(ctree2);
		
		pre.add(tree);
		tree.setChildren(chil);
		
		System.out.println(pre);
	}
	

}
